CC=g++
CFLAGS=-std=c++0x

OPATH=Obj
DIR=AN
BIN=Bin

SVC=$(DIR)/an.rpc_svc.c
IFACE_SVC=$(DIR)/an.rpc.h
APPS_SVC=$(DIR)/an.rpc_xdr.c $(DIR)/an.server.cpp
LIBS=$(OPATH)/log.o $(OPATH)/authr.o $(OPATH)/nsr.o $(OPATH)/ns-client*.o $(OPATH)/us-client*.o

all: client server

client:
	$(CC) $(CFLAGS) -c $(DIR)/an.client.cpp   -o $(OPATH)/an-client.o
	$(CC) $(CFLAGS) -c $(DIR)/an.rpc_clnt.c   -o $(OPATH)/an-client-rpc.o
	$(CC) $(CFLAGS) -c $(DIR)/an.rpc_xdr.c    -o $(OPATH)/an-client-xdr.o

server: $(IFACE_SVC) $(APPS_SVC)
	$(CC) $(CFLAGS) $(LIBS) $(APPS_SVC) $(SVC) -o $(BIN)/an-server

test:
	$(CC) $(CFLAGS) $(LIBS) $(OPATH)/an-client*.o $(DIR)/test.cpp -o $(BIN)/an-test
